import {
	HTTP
} from '../../utils/http.js'
import api from '../../utils/api.js'
let http = new HTTP()

Page({
	data: {
		list: []
	},
	onLoad: function (options) {
		this.getList();
	},
	getList() {
		let that = this
		http.request({
			url: api.reqInvestmentList,
			method: "GET",
			data: {
				page: 1
			},
			success: (res) => {
				if (res.code == 200) {
					that.setData({
						list: res.data.data
					})
				}
			}
		})
	},
	/**
	* 页面上拉触底事件的处理函数
	*/
	onReachBottom: function () {
		if (this.data.list.length == this.data.page * 10) {
			this.setData({
				page: this.data.page + 1
			})
			this.getList();
		} else {
			console.log("触底刷新");
		}

	},
})